package edu.swe632.otm.resources;

public class Endpoints {

	private String startAddress;
	
	private String destinationAddress;
	
	public Endpoints()
	{
		
	}
	
	public Endpoints(String startAddress, String destinationAddress)
	{
		setStartAddress(startAddress);
		setDestinationAddress(destinationAddress);
	}

	public String getStartAddress() {
		return startAddress;
	}

	public void setStartAddress(String startAddress) {
		this.startAddress = startAddress;
	}

	public String getDestinationAddress() {
		return destinationAddress;
	}

	public void setDestinationAddress(String destinationAddress) {
		this.destinationAddress = destinationAddress;
	}
	
	public String toString()
	{
		return "(" + startAddress + " - " + destinationAddress + ")";
	}
	
	public boolean equals(Object other)
	{
		if(!(other instanceof Endpoints))
		{
			return false;
		}
		Endpoints endpoint = (Endpoints) other;
		return startAddress.equals(endpoint.startAddress) &&
			destinationAddress.equals(endpoint.destinationAddress);
	}
	
	public int hashCode()
	{
		return 37 * (startAddress.hashCode() + destinationAddress.hashCode());
	}
}
